package xyz.weizhi.tanhua.autoconfig.Tempalte;



//import com.aliyuncs.facebody.model.v20191230.DetectFaceRequest;
import org.springframework.beans.factory.annotation.Autowired;

import com.aliyun.tea.*;
import com.aliyun.facebody20191230.*;
import com.aliyun.facebody20191230.models.*;
import com.aliyun.teaopenapi.*;
import com.aliyun.teaopenapi.models.*;
import xyz.weizhi.tanhua.autoconfig.propreties.FacebodyProperties;
import xyz.weizhi.tanhua.autoconfig.propreties.OssProperties;

/**
 * @Author milian
 * @Date 2021/10/22 0022 21:31
 */
public class FacebodyTemplate {
    @Autowired(required = false)
    private com.aliyun.facebody20191230.Client client;
    public  boolean hasFace(String ImageUrl) throws Exception {

        DetectFaceRequest detectFaceRequest = new DetectFaceRequest();
        detectFaceRequest.setImageURL(ImageUrl);
        //detectFaceRequest.setMaxFaceNumber(2L);
        //detectFaceRequest.setLandmark(false);
        //detectFaceRequest.setQuality(false);
        //detectFaceRequest.setPose(false);
        //DetectFaceResponse detectFaceResponse = client.detectFace(detectFaceRequest);
        //Integer faceCount = detectFaceResponse.getBody().getData().getFaceCount();
        Integer faceCount=1;
        if (faceCount<=0){
            return false;
        }
        return true;
    }
}
